Activate governed preproduction workflows (#1)#3
Conversation
* Recover UI repo selection fallback work * Add UI cockpit projection widgets * Add replay timeline frontend widget * Close governance replay phase 5 gaps * Implement Runtime Instrumentation & SVG Execution Visualization Phase 3 * Finalize runtime visualization convergence and SVG instrumentation doctrine * UX polishing * fix(tests): update UI tests for modularized frontend structure * Add startup onboarding and workspace composition updates * Fix widget registry and boot render guards * Add websocket instrumentation repro files * Refine documentation architecture and governance convergence * Clarify future architecture status * Add governed Rig workspace layout * Fix activation workflow checks * Stabilize preproduction operational smoke * Exercise governance routing and protected integration validation * Add CODEOWNER routing for governance rehearsal * Document solo maintainer governance limits * Canonicalize Rig operational substrate architecture * Implement operational runtime embodiment substrate * Audit runtime convergence toward canonical operational substrate * Audit runtime reconciliation and operational loop convergence * Audit operational control-plane convergence * Audit runtime reconciliation and operational loop convergence * Audit runtime reconciliation and operational loop convergence * Converge runtime surfaces on canonical lineage * Close remaining frontend canonical lineage gaps * Add ADRs for command, projection, governance, runtime, intake, workspace, and receipt domains * Document authority and public intake domains * Converge ADR index and status updates * Converge governed agent pipeline into preproduction * Add guarded worktree normalization tooling * Migrate docs to ADR sprint mission workflow * Add ADR mission ledger tooling * Add dataset exports and merge-friendliness preflight * Document deterministic preproduction promotion gate * Restore ADR 0004 runtime streaming import compatibility * Converge ADR 0004 runtime supervisor API * refactor: purge architectural documentation and proofs in favor of developer chronicles and new work utilities * Replace visualization prose contract with JSON schema check * Stabilize preproduction validation contracts * Stabilize preproduction validation contracts * Trigger preproduction validation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64eea0a0cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """Run a git command. Returns (returncode, stdout, stderr).""" | ||
| cmd = ["git"] + args | ||
| if cwd: | ||
| cmd = ["git", "-C", str(cwd)] + args[1:] if len(args) > 0 else ["git", "-C", str(cwd)] |
There was a problem hiding this comment.
Keep git subcommand when executing with -C
When cwd is provided, run_git rebuilds the command as ['git', '-C', <cwd>] + args[1:], which drops the subcommand (args[0]). Calls like run_git(['status', '--porcelain=v1'], cwd=wt.path) therefore execute git -C <path> --porcelain=v1, which Git rejects, so non-current worktree status/branch checks silently fail and overlap detection can miss conflicting dirty files.
Useful? React with 👍 / 👎.
| if rc == 0 and pp_head.strip(): | ||
| pp_head = pp_head.strip() | ||
| # Try merge-tree simulation | ||
| rc, output, _ = run_git(["merge-tree", "--write-tree=", current_head, pp_head]) |
There was a problem hiding this comment.
Pass valid merge-tree flag in promotion gate
Gate 12 runs git merge-tree with --write-tree=; this flag does not accept a value, so Git exits with an option error instead of simulating the merge. As a result, merge_simulation_passes is marked failed even for mergeable branches, which blocks promotion through the deterministic passage workflow.
Useful? React with 👍 / 👎.
| """Run a git command. Returns (returncode, stdout, stderr).""" | ||
| cmd = ["git"] + args | ||
| if cwd: | ||
| cmd = ["git", "-C", str(cwd)] + args[1:] if len(args) > 0 else ["git", "-C", str(cwd)] |
There was a problem hiding this comment.
Preserve subcommand when adding -C to git invocations
When cwd is set, run_git rebuilds the command with args[1:], which drops the git subcommand (args[0]). Calls such as run_git(['status', '--porcelain=v1'], cwd=wt.path) then become git -C <path> --porcelain=v1 and fail, so dirty-state checks for non-current worktrees can silently miss overlapping edits and incorrectly mark a patch as safe.
Useful? React with 👍 / 👎.
| if rc == 0 and pp_head.strip(): | ||
| pp_head = pp_head.strip() | ||
| # Try merge-tree simulation | ||
| rc, output, _ = run_git(["merge-tree", "--write-tree=", current_head, pp_head]) |
There was a problem hiding this comment.
Use a valid merge-tree invocation for gate 12
This gate calls git merge-tree with --write-tree=; the option takes no value, so Git exits with an option error instead of running the simulation. Since gate12_passed is then set false, promotions are blocked even when branches are mergeable.
Useful? React with 👍 / 👎.
| if ev.get("type") in [ | ||
| "patch_batch_planned", | ||
| "patch_batch_prechecked", | ||
| "patch_batch_applied", | ||
| "patch_batch_validated", | ||
| "patch_batch_blocked", | ||
| ] |
There was a problem hiding this comment.
Include merge-friendly events in doctor evidence scan
work_doctor searches patch_batch_events for patch_batch_merge_friendly_checked, but this filtered list never includes that event type. Any applied patch batch therefore looks like it has no merge-friendliness evidence, causing false commit-readiness failures even when checks were recorded.
Useful? React with 👍 / 👎.
| else: | ||
| current_info["is_detached"] = False | ||
| current_info["branch"] = head_ref |
There was a problem hiding this comment.
Parse worktree branch from 'branch' record, not HEAD
In git worktree list --porcelain, HEAD is a commit OID, not a branch ref. Assigning the HEAD value to current_info['branch'] leaves attached worktrees with invalid branch metadata, and downstream checks gated on wt.branch can be skipped incorrectly.
Useful? React with 👍 / 👎.
|
|
||
| if precheck_passed: | ||
| # Get current dirty files to see what would change | ||
| dirty = get_dirty_files() |
There was a problem hiding this comment.
Use patch paths instead of dirty tree for precheck output
After git apply --check passes, the script records planned_files from current git status dirt instead of the patch contents. In a dirty workspace this can attribute unrelated files (including protected paths) to the batch, producing false blocks and misleading ledger evidence.
Useful? React with 👍 / 👎.
| def get_patch_touched_files_git(patch_path: str | Path) -> list[str]: | ||
| """Use git apply --numstat to get touched files.""" | ||
| try: | ||
| rc, output, _ = run_git(["apply", "--numstat", "--atosh", str(patch_path)]) |
There was a problem hiding this comment.
Remove invalid --atosh option from git apply numstat call
get_patch_touched_files_git calls git apply --numstat --atosh, but --atosh is not a valid flag. This path consistently fails and silently drops the intended Git-derived file list, reducing touched-file detection quality.
Useful? React with 👍 / 👎.
| result.warnings.append( | ||
| f"Branch {wt.branch} ({wt.path}) has changes in patch files: {overlaps}" | ||
| ) | ||
| if result.result == "clean": | ||
| result.result = "warning" |
There was a problem hiding this comment.
Block merge-overlap conflicts instead of warning only
The merge-friendliness pass downgrades overlapping branch changes to warnings and keeps safe_to_apply true. This contradicts the documented rule that merge-conflict risk should block apply, so conflicting patches may still be approved.
Useful? React with 👍 / 👎.
| for ev in events: | ||
| if ev.get("type") == "handoff" and ev.get("mission_id") == mission_id: | ||
| mission_handoff_completed = True | ||
| mission_handoff_last = ev | ||
| break |
There was a problem hiding this comment.
Validate latest handoff event, not the first match
Gate 2 breaks on the first matching handoff event in chronological order. If an early incomplete handoff is later superseded by a complete one, promotion still fails on stale data instead of evaluating the most recent handoff state.
Useful? React with 👍 / 👎.
Recover UI repo selection fallback work
Add UI cockpit projection widgets
Add replay timeline frontend widget
Close governance replay phase 5 gaps
Implement Runtime Instrumentation & SVG Execution Visualization Phase 3
Finalize runtime visualization convergence and SVG instrumentation doctrine
UX polishing
fix(tests): update UI tests for modularized frontend structure
Add startup onboarding and workspace composition updates
Fix widget registry and boot render guards
Add websocket instrumentation repro files
Refine documentation architecture and governance convergence
Clarify future architecture status
Add governed Rig workspace layout
Fix activation workflow checks
Stabilize preproduction operational smoke
Exercise governance routing and protected integration validation
Add CODEOWNER routing for governance rehearsal
Document solo maintainer governance limits
Canonicalize Rig operational substrate architecture
Implement operational runtime embodiment substrate
Audit runtime convergence toward canonical operational substrate
Audit runtime reconciliation and operational loop convergence
Audit operational control-plane convergence
Audit runtime reconciliation and operational loop convergence
Audit runtime reconciliation and operational loop convergence
Converge runtime surfaces on canonical lineage
Close remaining frontend canonical lineage gaps
Add ADRs for command, projection, governance, runtime, intake, workspace, and receipt domains
Document authority and public intake domains
Converge ADR index and status updates
Converge governed agent pipeline into preproduction
Add guarded worktree normalization tooling
Migrate docs to ADR sprint mission workflow
Add ADR mission ledger tooling
Add dataset exports and merge-friendliness preflight
Document deterministic preproduction promotion gate
Restore ADR 0004 runtime streaming import compatibility
Converge ADR 0004 runtime supervisor API
refactor: purge architectural documentation and proofs in favor of developer chronicles and new work utilities
Replace visualization prose contract with JSON schema check
Stabilize preproduction validation contracts
Stabilize preproduction validation contracts
Trigger preproduction validation
Summary
Validation
scripts/ci/check.shNotes
Risk
Follow-up